<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
</head>
<body>
<div>
    <h1>用户列表</h1>
    <table th:border="1" th:width="200px">
        <tr>
            <td>用户名</td>
            <td>昵称</td>
            <td>年龄</td>
        </tr>

        <tr th:each="user:${userList}">
            <td th:width="80px" th:text="${user.username}" th:style="'background-color:'+(${user.odd}?'#fff':'#f5f2eb')"></td>
            <td th:width="60px" th:text="${user.nickname}" th:style="'background-color:'+(${user.odd}?'#fff':'#f5f2eb')"></td>
            <td th:width="60px" th:text="${user.age}" th:style="'background-color:'+(${user.odd}?'#fff':'#f5f2eb')"></td>
        </tr>
    </table>
</div>
</body>
</html>